<?php

require_once 'PHPCR/Repository/Exception.php';
require_once 'PHPCR/NodeType/NodeType.php';
require_once 'PHPCR/NodeType/NoSuchNodeTypeException.php';
require_once 'PHPCR/NodeType/Iterator.php';


/**
 * Allows for the retrieval of node types.
 * Accessed via Workspace#getNodeTypeManager.
 *
 * @package phpcr
 * @subpackage nodetype
 */
interface phpCr_NodeType_Manager
{
    /**
     * Returns the named node type.
     * <p>
     * Throws a <code>NoSuchNodeTypeException</code> if a node type by that name does not exist.
     * <p>
     * Throws a <code>RepositoryException</code> if another error occurs.
     *
     * @param nodeTypeName the name of an existing node type.
     * @return A <code>NodeType</code> object.
     * @throws NoSuchNodeTypeException if no node type by the given name exists.
     * @throws RepositoryException if another error occurs.
     */
    public function getNodeType( $nodeTypeName );

    /**
     * Returns an iterator over all available node types (primary and mixin).
     *
     * @return An <code>NodeTypeIterator</code>.
     * @throws RepositoryException if an error occurs.
     */
    public function getAllNodeTypes();

    /**
     * Returns an iterator over all available primary node types.
     *
     * @return An <code>NodeTypeIterator</code>.
     * @throws RepositoryException if an error occurs.
     */
    public function getPrimaryNodeTypes();

    /**
     * Returns an iterator over all available mixin node types.
     * If none are available, an empty iterator is returned.
     *
     * @return An <code>NodeTypeIterator</code>.
     * @throws RepositoryException if an error occurs.
     */
    public function getMixinNodeTypes();
}
